#include <vector>
using namespace std;


// version 1
class Solution {
public:
    void moveZeroes(vector<int>& nums) {
        int dest = -1, cur = 0;
        while(cur < nums.size()){
            if(nums[cur]){
                ++dest;
                std::swap(nums[cur], nums[dest]);    
            }
            ++cur;
        }
    }
};